//
//  MovingView.m
//  Pr2
//
//  Created by ZheZhun Xuan on 10/17/12.
//
//

#import "MovableView.h"
#import "PropertyItem.h"

@implementation MovableView
@synthesize index;
@synthesize item;
@synthesize lblTitle;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (id) initWithItem: (PropertyItem*) pItem
{
    self = [super init];
    if (self) {
        self.item = pItem;
        
        self.lblTitle = [[UILabel alloc] init];
        self.lblTitle.textColor = [UIColor colorWithRed: 0 green: 166.0f/255.0f blue: 170.0f/255.0f alpha:1.0f];
        self.lblTitle.backgroundColor = [UIColor clearColor];
        self.lblTitle.text = self.item.title;
        self.lblTitle.textAlignment = UITextAlignmentLeft;
        [self addSubview: self.lblTitle];
    }
    return self;
}

- (void) layoutSubviews
{
    self.lblTitle.frame = self.bounds;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
